package com.ssfGame.puremvc
{
	import api.dataStruct.GameApiInfo;
	import api.dataStruct.GameInfo;
	import api.dataStruct.InitAPIObj;
	
	import com.game.api.APICore;
	import com.ssfGame.puremvc.model.vo.ConfigVO;
	import com.ssfGame.puremvc.model.vo.LoadVO;
	import com.ssfGame.puremvc.view.module.queueload.vo.QueueLoadVO;
	import com.ssfGame.puremvc.view.module.queueload.vo.ShowLoadVO;
	
	import flash.display.Stage;

	public class StaticConst
	{
		
		public static var appStage:Stage;//保存stage;
		public static var configVO:ConfigVO;
		
		public static var gameId:uint=20420;
		public static var gameName:String="测试游戏";
		public static var actorList:Array=["actor1","actor2"];
		public static var totalPlayer:uint=2;
		public static var myInfo:GameApiInfo;
		public static var userInfo:GameApiInfo;
		public static var apiType:uint=InitAPIObj.TYPE_2;//设置API类型
		public static var isRobot:Boolean=false;//是否为机器人
		public static var apiCore:APICore=APICore.getInstance();//联机API通信类
		
		public static var configUrl:String="pvp_mvc_resource/data/config.txt";//config路径
		public static var RESOURCE_URL:String//资源地址
		
		public static var load_str_clew:String="正在加载数据";
		public static var load_media_clew:String="正在加载资源";
		public static const V_SUCCESS:String="v_success";//加载成功
		public static const V_FAILED:String="v_failel";//加载失败
		public static const V_JSON:String="v_json"; //加载类型,json
		public static const V_IMG:String="v_img";//加载类型,json
		public static const V_SWF:String="v_swf";//加载类型,json
		
		
		public static const N_C_LOAD:String="n_c_load";//加载swf,img,json
		public static const N_C_STARTUP:String="n_c_startup";//程序启动body：application
		
		//控制主层级显示对象	
		public static const N_M_SCENE_LAYER_ADD:String="n_m_add_scene";//向scene添加对象
		public static const N_M_SCENE_LAYER_DEL:String="n_m_del_scene";//向scene删除对象
		public static const N_M_TIP_LAYER_ADD:String="n_m_add_tip";//向scene添加对象
		public static const N_M_TIP_LAYER_DEL:String="n_m_del_tip";//向scene删除对象
		public static const N_M_CONTROL_LAYER_ADD:String="n_m_control_layer_add";//向contorl层添加对象
		public static const N_M_CONTROL_LAYER_DEL:String="n_m_control_layer_del";//删除control层对象
		
		public static const N_M_POPUP_LAYER_ADD:String="n_m_popup_layer_add";//添加动态层.
		public static const N_M_POPUP_LAYER_DEL:String="n_m_popup_layer_del";//删除动态层
		public static const N_M_LOAD_LAYER_ADD:String="n_m_add_load_layer";//添加加载提示
		public static const N_M_LOAD_LAYER_DEL:String="n_m_del_load_layer";//删除加载提示
		
		
		public static const N_M_API_LAYER_ADD:String="n_m_api_layer_add";//向api层添加对象
		
		public static const N_M_TITLE_ADD:String="n_m_title_add";//添加title对象
		public static const N_M_TITLE_DEL:String="n_m_title_del";//删除title对象
		
		public static const N_M_GAME_ADD:String="n_m_game_add";//添加game对象
		public static const N_M_GAME_DEL:String="n_m_game_del";//删除game对象
		
		public static const N_M_GAME_OVER_ADD:String="n_m_game_over_add";//添加gameOver对象
		public static const N_M_GAME_OVER_DEL:String="n_m_game_over_del";//删除gameOver对象
		
		//
		public static const N_C_LOAD_CONFIG:String="n_c_config_load";//加载配置文件
		public static const N_C_LOAD_INITLOADER:String="n_c_initLoader_load";//加载初始化基础素材
		public static const N_C_LOAD_COMMON:String="n_c_common";//公共资源加载
		public static const N_C_INIT_GAME_STAGE:String="n_c_init_game";//初始化游戏场景
		public static const N_C_SHOW_LOGO_MOVIE:String="n_c_show_logo_movie";//显示logo动画
		
		public static const N_C_INIT_BASE_API:String="n_c_init_base_api";//初始化基本组件
		
		
		public static const N_C_INIT_PVP_API:String="n_c_init_pvp_api";//初始化PVP组件
		//资源加载	
		public static const N_M_QUEUE_LOAD_BIG_SHOW:String="n_m_queue_load_big_show";//显示大列队加载面板
		public static const N_M_QUEUE_LOAD_SMALL_SHOW:String="n_m_queue_load_small_show";//显示小列队加载面板
		public static const N_M_QUEUE_LOAD_PANEL_DEL:String="n_m_queue_load_panel_del";//删除列队加载面板
		public static const N_M_QUEUE_LOAD_PROGRESS:String="n_m_queue_load_progress";//列队加载进度
		public static const N_M_LOAD_ERROR:String="n_m_load_error";//加载失败
		public static const N_M_JSON_LOAD_ERROR:String="n_m_json_load_error";//json数据加载错误
		
		
	
		
		
		
		public static function getInitAPIObj():InitAPIObj{
			
			return new InitAPIObj(apiType,new GameInfo(gameId,gameName,totalPlayer,configVO.GAMEW,configVO.GAMEH,actorList),true);
			
		}
		
		/**
		 * 获取queueLoadVC
		 * @param queueName  queueLoadVC 的名称
		 * @param type loadVO类型v_json/v_swf,
		 * @param url 地址
		 * @param title 标题
		 */
		public static function getQueueLoadVO(queueLoadVOFun:Function,type:String,url:String,loadType:String=null,title:String=null,loadID:String="0"):QueueLoadVO{
			
			var queueLoadVO:QueueLoadVO = new QueueLoadVO();
			queueLoadVO.callBakcFun=queueLoadVOFun;
			if(loadType!=null){
				queueLoadVO.showLoadVO=new ShowLoadVO(loadType,title,loadID);
			}
			queueLoadVO.loadVec.push(getLoadVO(type,url,title));
			return queueLoadVO;
		}
		/**
		 * 获取loadVO
		 * 
		 * @param type loadVO类型v_json/v_swf,
		 * @param url 地址
		 * @param title 标题
		 * 
		 * */
		public static function getLoadVO(type:String,url:String,title:String="", domain:int = 1):LoadVO{
			var loadVO:LoadVO = new LoadVO();
			loadVO.title =title;
			loadVO.type = type;
			loadVO.url =url;
			loadVO.domain = domain;
			return loadVO;
		}
	}
	
	
}